﻿using System.Reflection;

namespace Mbs.ComponentModel.Container.Injection
{
    public class AutoPropertyInspect:PropertyInspect
    {
        protected override bool Filter(InjectAttribute att, PropertyInfo p, ParameterInfo[] ps)
        {
            if (ps != null && ps.Length > 0)
                return false;
            if (!p.CanWrite)
                return false;
            if (p.GetSetMethod() == null)
                return false;

            return Kernel.HasRegister(p.PropertyType);
        }
    }
}
